package com.stu.entity.sys;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.stu.entity.base.BaseEntity;
import com.stu.entity.permission.PermissionUser;

@Entity
@Table(name = "LOG4j")
public class Log4jBean extends BaseEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String message;//%m   输出代码中指定的消息
	private String priority;//%p   输出优先级，即DEBUG，INFO，WARN，ERROR，FATAL 
	private String rmseconds;//%r   输出自应用启动到输出该log信息耗费的毫秒数
	private String threadName;//%t   输出产生该日志事件的线程名
	private String logDate;////%d   输出日志时间点的日期或时间，默认格式为ISO8601，也可以在其后指定格式，比如：%d{yyy MMM dd HH:mm:ss , SSS}，输出类似：2002年10月18日  22 ： 10 ： 28 ， 921
	private String location;//%l   输出日志事件的发生位置，包括类目名、发生的线程，以及在代码中的行数。举例：Testlog4.main(TestLog4.java: 10
	private String className;//%c   输出所属的类目，通常就是所在类的全名
//	private PermissionUser user;//操作用户
	
	@Column(name = "message")
	@Type(type="text")
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	@Column(name = "priority", length = 30)
	public String getPriority() {
		return priority;
	}
	public void setPriority(String priority) {
		this.priority = priority;
	}
	@Column(name = "rmseconds",length=100)
	public String getRmseconds() {
		return rmseconds;
	}
	public void setRmseconds(String rmseconds) {
		this.rmseconds = rmseconds;
	}
	@Column(name = "threadname", length = 100)
	public String getThreadName() {
		return threadName;
	}
	public void setThreadName(String threadName) {
		this.threadName = threadName;
	}
	@Column(name = "logdate")
	public String getLogDate() {
		return logDate;
	}
	public void setLogDate(String logDate) {
		this.logDate = logDate;
	}
	@Column(name = "location", length = 500)
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	@Column(name = "classname", length = 200)
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
//	@ManyToOne(fetch = FetchType.LAZY)
//	@JoinColumn(name = "user")
//	public PermissionUser getUser() {
//		return user; 
//	}
//	public void setUser(PermissionUser user) {
//		this.user = user;
//	}
	public Log4jBean() {
		super();
	}
	public Log4jBean(String uuid) {
		super(uuid);
	}
	public Log4jBean(String message, String priority, String rmseconds, String threadName, String logDate,
			String location, String className, PermissionUser user) {
		super();
		this.message = message;
		this.priority = priority;
		this.rmseconds = rmseconds;
		this.threadName = threadName;
		this.logDate = logDate;
		this.location = location;
		this.className = className;
	}
	@Override
	public String toString() {
		return "Log4jBean [message=" + message + ", priority=" + priority + ", rmseconds=" + rmseconds + ", threadName="
				+ threadName + ", logDate=" + logDate + ", location=" + location + ", className=" + className
				+"]";
	}
	
	
	
	
	

}
